package com.mm.cloud.common.core.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 实体基础类
 *
 * @author mr
 * @since 2021-06-30
 */
@Data
public class BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "修改时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @Schema(description = "创建人ID")
    @TableField(value = "creater_id")
    private Long createrId;

    @Schema(description = "修改人ID")
    @TableField(value = "updater_id")
    private Long updaterId;

    @Schema(description = "逻辑删除 1-是 0-否")
    @TableField(value = "is_delete", fill = FieldFill.INSERT)
    private Byte isDelete;

}
